AC_DEFUN([TM_ANDROID], [

    if test "x$SVNINT" != "x"; then
      AC_SUBST([TEXMACS_ANDROID_VERSION_CODE], [$SVNINT])
    elif test "x$TEXMACS_ANDROID_VERSION_CODE" != "x"; then
      AC_SUBST([TEXMACS_ANDROID_VERSION_CODE], [$TEXMACS_ANDROID_VERSION_CODE])
    else
      AC_MSG_ERROR([Please set $TEXMACS_ANDROID_VERSION_CODE shell variable.])
    fi

    AC_SUBST(QT_ANDROID_PATH)

    AC_SUBST([QT_ANDROID_QT_ROOT], [$QT_ANDROID_PATH])

    AC_SUBST([QT_ANDROID_SDK_ROOT], [$ANDROID_SDK_ROOT])

    AC_SUBST([QT_ANDROID_NDK_ROOT], [$ANDROID_NDK_ROOT])

    AC_SUBST([QT_ANDROID_SDK_BUILDTOOLS_REVISION], ["$BUILD_TOOLS_REVISION"])

    AC_SUBST([QT_ANDROID_TOOLCHAIN_PREFIX], ["llvm"])

    AC_SUBST([QT_ANDROID_TOOLCHAIN_VERSION], ["4.9"])

    AC_SUBST([QT_ANDROID_TOOL_PREFIX], ["llvm"])

    AC_SUBST([ANDROID_NDK_HOST_SYSTEM_NAME], ["$ANDROID_NDK_HOST"])

    AC_SUBST([QT_ANDROID_ARCHITECTURES], ["\"$ANDROID_ABI\":\"$ANDROID_ARCH_SYSROOT_TAG\""])

    AC_SUBST([QT_ANDROID_TARGET_SDK_VERSION], ["$QT_ANDROID_TARGET_SDK_VERSION"])

    AC_SUBST([ANDROID_ABI], ["$ANDROID_ABI"])

    AC_SUBST([ANDROID_API], ["$ANDROID_API"])

    AC_SUBST([QT_ANDROID_APPLICATION_BINARY], ["TeXmacs"])

    AC_SUBST([QT_ANDROID_APP_PACKAGE_NAME], ["org.texmacs"])

    AC_SUBST([QT_ANDROID_APP_NAME], ["TeXmacs"])

    AC_SUBST([CMAKE_SOURCE_DIR], [`pwd`])

    AC_SUBST([QT_ANDROID_STL_PATH], ["$QT_ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/$ANDROID_NDK_HOST/sysroot/usr/lib"])

    AC_SUBST([QT_ANDROID_USE_LLVM], ["false"])

    AC_SUBST([QT_ANDROID_APP_EXTRA_LIBS], [""])

    AC_SUBST([QT_ANDROID_APP_PACKAGE_SOURCE_ROOT], [`pwd`/../distr/TeXmacs-Android/sources])

    AC_SUBST([QT_HOST_PATH], ["$QT_HOST_PATH"])

    AC_SUBST([QT_PATH], ["$QT_PATH"])

    AC_SUBST([SDK], ["$SDK"])

    AC_SUBST([NDK], ["$NDK"])

])
